import numpy as np
import matplotlib.pyplot as plt

# 设置中文显示
plt.rcParams["font.family"] = ["SimHei", "WenQuanYi Micro Hei", "Heiti TC"]

# 生成数据点
t = np.linspace(0, 2 * np.pi, 1000)
x = 16 * np.sin(t) ** 3
y = 13 * np.cos(t) - 5 * np.cos(2*t) - 2 * np.cos(3*t) - np.cos(4*t)

# 创建图形
plt.figure(figsize=(8, 6))
plt.plot(x, y, color='red', linewidth=3)

# 设置标题和坐标轴
plt.title('爱心图形', fontsize=16)
plt.axis('equal')  # 等比例显示
plt.axis('off')    # 隐藏坐标轴

# 显示图形
plt.show()
